package com.mbigger.sigar.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.mbigger.sigar.bean.CpuUsage;
import com.mbigger.sigar.bean.DiskUsage;
import com.mbigger.sigar.bean.MemUsage;
import com.mbigger.sigar.service.SystemInformationService;

@RestController
@RequestMapping("/sigar")
public class SigarController {
    @Autowired
    private SystemInformationService service;

    @GetMapping("/cpuInfo")
    public CpuUsage getCpuInfo() {
        return service.getCpuInfo();
    }

    @GetMapping("/memInfo")
    public MemUsage getMemInfo() {
        return service.getMemInfo();
    }

    @GetMapping("/diskInfo")
    public List<DiskUsage> getDiskUsage() {
        return service.getDiskUsage();
    }
}
